"""
-------------------------------
- File_Name: student.py
- Date: 2025/2/11
- Author: yangzhide
- Email: xxzjyzd@126.com
- Description: 学生相关模型
-------------------------------
"""

from tortoise.models import Model
from tortoise import fields

class Student(Model):
    id = fields.IntField(pk=True)
    sno = fields.IntField(description="学号")
    name = fields.CharField(max_length=120,description="学生名称")
    pwd = fields.CharField(max_length=120, description="密码")
    note = fields.CharField(blank=True, null=True, max_length=255, description="备注")
    disabled = fields.BooleanField(default=True, null=True, description="禁用")

    def __str__(self):
        """用户友好，打印输出简洁易读的字符串"""
        return self.name
    def __repr__(self):
        """开发者调试，调用输出精确的字符串"""
        return f"<Student:,{self.name}>"


class Teacher(Model):
    id = fields.IntField(pk=True)
    tno =fields.IntField(ddescription="账号")
    name = fields.CharField(max_length=120, description="教师名称")
    pwd = fields.CharField(max_length=32, description="密码")

class Clas(Model):
    id = fields.IntField(pk=True)
    name = fields.CharField(max_length=120, description="班级名称")

class Coures(Model):
    id = fields.IntField(pk=True)
    name = fields.CharField(max_length=120, description="课程名称")
